#ifndef _YL_MESSAGE_TEMPLATE_
#define _YL_MESSAGE_TEMPLATE_

namespace yoctolog_viewer
{
	ref class LogMessageGroup;
	ref class LogMessageClass;

	[System::SerializableAttribute]
	public ref class LogMessageTemplate: public ISerializable
	{
	public:
		System::String ^										m_strText;
		System::Collections::Generic::List<LogMessageGroup^> ^	m_vecGroups;
		LogMessageClass ^										m_pMessageClass;

		LogMessageTemplate()
		{
			m_vecGroups = gcnew System::Collections::Generic::List<LogMessageGroup^>();
		}

		~LogMessageTemplate()
		{
			delete m_vecGroups;
		}

		// Serialization
		virtual void GetObjectData(System::Runtime::Serialization::SerializationInfo ^info, System::Runtime::Serialization::StreamingContext context)
		{
			info->AddValue("m_strText", m_strText);
			info->AddValue("m_vecGroups", m_vecGroups);
			info->AddValue("m_pMessageClass", m_pMessageClass);
		}

		LogMessageTemplate(System::Runtime::Serialization::SerializationInfo ^info, System::Runtime::Serialization::StreamingContext context)
		{
			m_strText = info->GetString("m_strText");
			m_vecGroups = (System::Collections::Generic::List<LogMessageGroup^> ^)info->GetValue("m_vecGroups", System::Collections::Generic::List<LogMessageGroup^>::typeid);
			m_pMessageClass = (LogMessageClass ^)info->GetValue("m_pMessageClass", LogMessageClass::typeid);
		}

		//System::String ^		pFormatString;
	};
}

#endif